 const json  = [
  {
    "label": "需求提报",
    "route": "needCreate",
    "children": [
      {
        "label": "功能概述",
        "icon": "overview"
      },
      {
        "label": "新建采购需求",
        "icon": "create"
      },
      {
        "label": "复制采购需求",
        "icon": "copy"
      },
      {
        "label": "需求记录查询",
        "icon": "query"
      },
      {
        "label": "需求取消",
        "icon": "close"
      }
    ]
  },
  {
    "label": "订单跟踪",
    "route": "orderTrack",
    "children": [
      {
        "label": "功能概述",
        "icon": "overview"
      },
      {
        "label": "订单付款",
        "icon": "orderPay"
      },
      {
        "label": "订单确认收货",
        "icon": "confirmReceipt"
      },
      {
        "label": "订单查询",
        "icon": "query"
      },
    ]
  },
  {
    "label": "发票管理",
    "route": "invoice",
    "children": [
      {
        "label": "发票管理功能",
        "icon": "overview"
      },
    ]
  }
]


export const treeJSON = ()=>{
  return json.map((row:any)=>{
    return {
      ...row,
      children: row.children.map((item:any)=>{
        return {
          ...item,
          route: row.route + '-' + item.icon
        }
      })
    }
  })
}
